package main

import "fmt"

type Pupil struct {
	Name string
	Age int
	Score int
}

func (p *Pupil) ShowInfo() {
	fmt.Printf("学生的名字=%v 年龄=%v\n", p.Name, p.Age)
}

func (p *Pupil) SetScore(score int) {
	// 业务判断
	p.Score = score
}

func (p *Pupil) testing() {
	fmt.Println("小学生正在考试中...")
}

func main() {

	var pupil = &Pupil {
		Name : "tom",
		Age : 10,
	}
	pupil.testing()
	pupil.SetScore(50)
	pupil.ShowInfo()

}